<script>		
		 jQuery(window).load(function() {	
		 $x = $(window).width();		
	if($x > 1024)
	{			
	jQuery("#content .row").preloader();}	
	
	jQuery(".list-blog li:last-child").addClass("last"); 
	jQuery(".list li:last-child").addClass("last"); 

	
  		  }); 
					
</script>
<div class="span7">
	<div id="Blog1" class="widget Blog">
		<div class="blog-posts hfeed">
		<?php if (isset($posts) && is_array($posts) && count($posts)) :?>
			<div class="date-outer">
				<div class="date-posts">
					<?php foreach ($posts as $post) :?>
					<div class="post-outer">
						<div class="post hentry" itemtype="http://schema.org/BlogPosting" itemscope="itemscope" itemprop="blogPost">
							<h2 class="post-title entry-title">
								<?php echo $post->title ?>
							</h2>
							<div class="post-header">
								<div class="post-header-line-1"></div>
								<span class="post-author vcard">
									Posted by <span class="fn">Admin</span>
								</span>	
								<span class="post-timestamp">
									at <span class="fn"><?php echo $post->created_on ?></span>
								</span>
							</div>
							<div trbidi="on" style="text-align: left;" dir="ltr">
								<div class="post-header" style="clear: both; text-align: center;">
									<iframe width="540" height="250" src="http://www.youtube.com/embed/<?php echo $post->url?>?rel=0" frameborder="0" allowfullscreen></iframe>
								</div>
								<div class="post-header">
									<?php  
									$desc = strip_tags($post->description);
									echo substr($desc, 0,200)."..."; 
									?>
								</div>
							</div>
							<div style="clear: both;"></div>
							<div class="jump-link">
								<a class="btn btn-primary" href="<?php echo site_url('blog/view/'.$post->id)?>">Read more »</a>
							</div>
						</div>
					</div>
					<?php endforeach; ?>
				</div>
			</div>
			<?php else : ?>
			      	<h3>No Posts were found.</h3>
		<?php endif; ?> 	
		</div>
	</div>
</div>
<div class="span4">
	<table>
		<h2>Most viewed</h2>
		<?php if(!empty($viewed)):?>
			<?php foreach($viewed as $view):?>
			<tr>
				<td style="float:left">
					<a href="<?php echo site_url('blog/view/'.$view->id)?>"><h3><?php echo $view->title?></h3>
						<img width="170" height="150" alt="" src="http://img.youtube.com/vi/<?php echo $view->url?>/mqdefault.jpg">
					</a>
				</td>
			</tr>
			<?php endforeach;?>
		<?php else:?>
		<tr>
			<td style="float:left">
				Their is no most viewed video.
			</td>
		</tr>
		<?php endif;?>	
	</table>
	<br/>
	<table>
		<h2>Most liked</h2>
		<?php if(!empty($liked)):?>
			<?php foreach($liked as $like):?>
			<tr>
				<td style="float:left">
					<a href="<?php echo site_url('blog/view/'.$like->id)?>"><h3><?php echo $like->title?></h3>
						<img width="170" height="150" alt="" src="http://img.youtube.com/vi/<?php echo $like->url?>/mqdefault.jpg">
					</a>	
				</td>
			</tr>
			<?php endforeach;?>
		<?php else:?>
			<tr>
				<td style="float:left">
					Their is no liked video.
				</td>
			</tr>
		<?php endif;?>
	</table>
</div>